/*
 * SaleItemList.h
 *
 *  Created on: Mar 25, 2010
 *      Author: mike
 */

//*************************************************************************
// File Name: SaleItemList.h
// Definition of SaleItemList class - a class that manages a list of items
// that are on for sale, holding info on its name, price and quantity.
// "Group 3"
// CS 1C
// March 25, 2010
// Group Project: SuperWarehouse
// Due: March 25, 2010
// - KZ's comment
//*************************************************************************

#ifndef SALEITEMLIST_H_
#define SALEITEMLIST_H_

#include "GenericList.h"
#include <iostream>

using namespace std;

class SaleItemList {
public:
	//*****************************************************************
	// Data structure containing a single node for SaleItemList
	//*****************************************************************
	struct SaleItem {
		string name;
		int totalQty;
		float totalSales;
	};

	//*****************************************************************
	// Default constructor
	// Postcondition: Member variables have been initialized
	//*****************************************************************
	SaleItemList();

	//*****************************************************************
	// Destructor
	// Precondition: Item has been initialized
	// Postcondition: Resources released
	//*****************************************************************
	virtual ~SaleItemList();

	//*****************************************************************
	// Adds an item to the list of sales
	// Precondition: None
	// Postcondition: Sales list is updated with item and price. If
	//	itemName already exists, its price value is increased. If
	//	itemName does not exist, it is added to the list.
	//*****************************************************************
	void addItem(string itemName, float price, int qty);

	//*****************************************************************
	// Accessor for items list
	// Precondition: None
	// Postcondition: List is returned
	//*****************************************************************
	GenericList<SaleItem> *getItems();

private:
	//*****************************************************************
	// Data structure containing list of sale items
	//*****************************************************************
	GenericList<SaleItem> items;
};

#endif /* SALEITEMLIST_H_ */
